import React from 'react';
import Formuser, { isProps } from './form_user';
import { Form } from 'antd';
import { connect } from 'dva';

export default connect(({ dict }: any) => ({ auth: dict.view }))(
  Form.create({
    mapPropsToFields(props: isProps) {
      return {
        label: Form.createFormField({
          value: props.auth.label,
        }),
        value: Form.createFormField({
          value: props.auth.value,
        }),
        standardCode: Form.createFormField({
          value: props.auth.standardCode,
        }),
        type: Form.createFormField({
          value: props.auth.type,
        }),
        sort: Form.createFormField({
          value: props.auth.sort,
        }),
        description: Form.createFormField({
          value: props.auth.description,
        }),
      };
    },
  })(Formuser),
);
